Left Termination of the query pattern ackermann_in_3(g, g, a) w.r.t. the given Prolog program could successfully be proven:



Prolog
  ↳ PrologToPiTRSProof

Clauses:

ackermann(0, N, s(N)).
ackermann(s(M), 0, Res) :- ackermann(M, s(0), Res).
ackermann(s(M), s(N), Res) :- ','(ackermann(s(M), N, Res1), ackermann(M, Res1, Res)).

Queries:

ackermann(g,g,a).

We use the technique of [30]. With regard to the inferred argument filtering the predicates were used in the following modes:
ackermann_in: (b,b,f)
Transforming Prolog into the following Term Rewriting System:
Pi-finite rewrite system:
The TRS R consists of the following rules:

ackermann_in_gga(0, N, s(N)) → ackermann_out_gga(0, N, s(N))
ackermann_in_gga(s(M), 0, Res) → U1_gga(M, Res, ackermann_in_gga(M, s(0), Res))
ackermann_in_gga(s(M), s(N), Res) → U2_gga(M, N, Res, ackermann_in_gga(s(M), N, Res1))
U2_gga(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → U3_gga(M, N, Res, ackermann_in_gga(M, Res1, Res))
U3_gga(M, N, Res, ackermann_out_gga(M, Res1, Res)) → ackermann_out_gga(s(M), s(N), Res)
U1_gga(M, Res, ackermann_out_gga(M, s(0), Res)) → ackermann_out_gga(s(M), 0, Res)

The argument filtering Pi contains the following mapping:
ackermann_in_gga(x1, x2, x3)  =  ackermann_in_gga(x1, x2)
0  =  0
ackermann_out_gga(x1, x2, x3)  =  ackermann_out_gga(x3)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3)  =  U1_gga(x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)

Infinitary Constructor Rewriting Termination of PiTRS implies Termination of Prolog



↳ Prolog
  ↳ PrologToPiTRSProof
PiTRS
      ↳ DependencyPairsProof

Pi-finite rewrite system:
The TRS R consists of the following rules:

ackermann_in_gga(0, N, s(N)) → ackermann_out_gga(0, N, s(N))
ackermann_in_gga(s(M), 0, Res) → U1_gga(M, Res, ackermann_in_gga(M, s(0), Res))
ackermann_in_gga(s(M), s(N), Res) → U2_gga(M, N, Res, ackermann_in_gga(s(M), N, Res1))
U2_gga(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → U3_gga(M, N, Res, ackermann_in_gga(M, Res1, Res))
U3_gga(M, N, Res, ackermann_out_gga(M, Res1, Res)) → ackermann_out_gga(s(M), s(N), Res)
U1_gga(M, Res, ackermann_out_gga(M, s(0), Res)) → ackermann_out_gga(s(M), 0, Res)

The argument filtering Pi contains the following mapping:
ackermann_in_gga(x1, x2, x3)  =  ackermann_in_gga(x1, x2)
0  =  0
ackermann_out_gga(x1, x2, x3)  =  ackermann_out_gga(x3)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3)  =  U1_gga(x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)


Using Dependency Pairs [1,30] we result in the following initial DP problem:
Pi DP problem:
The TRS P consists of the following rules:

ACKERMANN_IN_GGA(s(M), 0, Res) → U1_GGA(M, Res, ackermann_in_gga(M, s(0), Res))
ACKERMANN_IN_GGA(s(M), 0, Res) → ACKERMANN_IN_GGA(M, s(0), Res)
ACKERMANN_IN_GGA(s(M), s(N), Res) → U2_GGA(M, N, Res, ackermann_in_gga(s(M), N, Res1))
ACKERMANN_IN_GGA(s(M), s(N), Res) → ACKERMANN_IN_GGA(s(M), N, Res1)
U2_GGA(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → U3_GGA(M, N, Res, ackermann_in_gga(M, Res1, Res))
U2_GGA(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → ACKERMANN_IN_GGA(M, Res1, Res)

The TRS R consists of the following rules:

ackermann_in_gga(0, N, s(N)) → ackermann_out_gga(0, N, s(N))
ackermann_in_gga(s(M), 0, Res) → U1_gga(M, Res, ackermann_in_gga(M, s(0), Res))
ackermann_in_gga(s(M), s(N), Res) → U2_gga(M, N, Res, ackermann_in_gga(s(M), N, Res1))
U2_gga(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → U3_gga(M, N, Res, ackermann_in_gga(M, Res1, Res))
U3_gga(M, N, Res, ackermann_out_gga(M, Res1, Res)) → ackermann_out_gga(s(M), s(N), Res)
U1_gga(M, Res, ackermann_out_gga(M, s(0), Res)) → ackermann_out_gga(s(M), 0, Res)

The argument filtering Pi contains the following mapping:
ackermann_in_gga(x1, x2, x3)  =  ackermann_in_gga(x1, x2)
0  =  0
ackermann_out_gga(x1, x2, x3)  =  ackermann_out_gga(x3)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3)  =  U1_gga(x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x4)
U1_GGA(x1, x2, x3)  =  U1_GGA(x3)
ACKERMANN_IN_GGA(x1, x2, x3)  =  ACKERMANN_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)

We have to consider all (P,R,Pi)-chains

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
PiDP
          ↳ DependencyGraphProof

Pi DP problem:
The TRS P consists of the following rules:

ACKERMANN_IN_GGA(s(M), 0, Res) → U1_GGA(M, Res, ackermann_in_gga(M, s(0), Res))
ACKERMANN_IN_GGA(s(M), 0, Res) → ACKERMANN_IN_GGA(M, s(0), Res)
ACKERMANN_IN_GGA(s(M), s(N), Res) → U2_GGA(M, N, Res, ackermann_in_gga(s(M), N, Res1))
ACKERMANN_IN_GGA(s(M), s(N), Res) → ACKERMANN_IN_GGA(s(M), N, Res1)
U2_GGA(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → U3_GGA(M, N, Res, ackermann_in_gga(M, Res1, Res))
U2_GGA(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → ACKERMANN_IN_GGA(M, Res1, Res)

The TRS R consists of the following rules:

ackermann_in_gga(0, N, s(N)) → ackermann_out_gga(0, N, s(N))
ackermann_in_gga(s(M), 0, Res) → U1_gga(M, Res, ackermann_in_gga(M, s(0), Res))
ackermann_in_gga(s(M), s(N), Res) → U2_gga(M, N, Res, ackermann_in_gga(s(M), N, Res1))
U2_gga(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → U3_gga(M, N, Res, ackermann_in_gga(M, Res1, Res))
U3_gga(M, N, Res, ackermann_out_gga(M, Res1, Res)) → ackermann_out_gga(s(M), s(N), Res)
U1_gga(M, Res, ackermann_out_gga(M, s(0), Res)) → ackermann_out_gga(s(M), 0, Res)

The argument filtering Pi contains the following mapping:
ackermann_in_gga(x1, x2, x3)  =  ackermann_in_gga(x1, x2)
0  =  0
ackermann_out_gga(x1, x2, x3)  =  ackermann_out_gga(x3)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3)  =  U1_gga(x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x4)
U1_GGA(x1, x2, x3)  =  U1_GGA(x3)
ACKERMANN_IN_GGA(x1, x2, x3)  =  ACKERMANN_IN_GGA(x1, x2)
U3_GGA(x1, x2, x3, x4)  =  U3_GGA(x4)

We have to consider all (P,R,Pi)-chains
The approximation of the Dependency Graph [30] contains 1 SCC with 2 less nodes.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
PiDP
              ↳ PiDPToQDPProof

Pi DP problem:
The TRS P consists of the following rules:

U2_GGA(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → ACKERMANN_IN_GGA(M, Res1, Res)
ACKERMANN_IN_GGA(s(M), s(N), Res) → ACKERMANN_IN_GGA(s(M), N, Res1)
ACKERMANN_IN_GGA(s(M), 0, Res) → ACKERMANN_IN_GGA(M, s(0), Res)
ACKERMANN_IN_GGA(s(M), s(N), Res) → U2_GGA(M, N, Res, ackermann_in_gga(s(M), N, Res1))

The TRS R consists of the following rules:

ackermann_in_gga(0, N, s(N)) → ackermann_out_gga(0, N, s(N))
ackermann_in_gga(s(M), 0, Res) → U1_gga(M, Res, ackermann_in_gga(M, s(0), Res))
ackermann_in_gga(s(M), s(N), Res) → U2_gga(M, N, Res, ackermann_in_gga(s(M), N, Res1))
U2_gga(M, N, Res, ackermann_out_gga(s(M), N, Res1)) → U3_gga(M, N, Res, ackermann_in_gga(M, Res1, Res))
U3_gga(M, N, Res, ackermann_out_gga(M, Res1, Res)) → ackermann_out_gga(s(M), s(N), Res)
U1_gga(M, Res, ackermann_out_gga(M, s(0), Res)) → ackermann_out_gga(s(M), 0, Res)

The argument filtering Pi contains the following mapping:
ackermann_in_gga(x1, x2, x3)  =  ackermann_in_gga(x1, x2)
0  =  0
ackermann_out_gga(x1, x2, x3)  =  ackermann_out_gga(x3)
s(x1)  =  s(x1)
U1_gga(x1, x2, x3)  =  U1_gga(x3)
U2_gga(x1, x2, x3, x4)  =  U2_gga(x1, x4)
U3_gga(x1, x2, x3, x4)  =  U3_gga(x4)
U2_GGA(x1, x2, x3, x4)  =  U2_GGA(x1, x4)
ACKERMANN_IN_GGA(x1, x2, x3)  =  ACKERMANN_IN_GGA(x1, x2)

We have to consider all (P,R,Pi)-chains
Transforming (infinitary) constructor rewriting Pi-DP problem [30] into ordinary QDP problem [15] by application of Pi.

↳ Prolog
  ↳ PrologToPiTRSProof
    ↳ PiTRS
      ↳ DependencyPairsProof
        ↳ PiDP
          ↳ DependencyGraphProof
            ↳ PiDP
              ↳ PiDPToQDPProof
QDP
                  ↳ QDPSizeChangeProof

Q DP problem:
The TRS P consists of the following rules:

ACKERMANN_IN_GGA(s(M), s(N)) → U2_GGA(M, ackermann_in_gga(s(M), N))
U2_GGA(M, ackermann_out_gga(Res1)) → ACKERMANN_IN_GGA(M, Res1)
ACKERMANN_IN_GGA(s(M), 0) → ACKERMANN_IN_GGA(M, s(0))
ACKERMANN_IN_GGA(s(M), s(N)) → ACKERMANN_IN_GGA(s(M), N)

The TRS R consists of the following rules:

ackermann_in_gga(0, N) → ackermann_out_gga(s(N))
ackermann_in_gga(s(M), 0) → U1_gga(ackermann_in_gga(M, s(0)))
ackermann_in_gga(s(M), s(N)) → U2_gga(M, ackermann_in_gga(s(M), N))
U2_gga(M, ackermann_out_gga(Res1)) → U3_gga(ackermann_in_gga(M, Res1))
U3_gga(ackermann_out_gga(Res)) → ackermann_out_gga(Res)
U1_gga(ackermann_out_gga(Res)) → ackermann_out_gga(Res)

The set Q consists of the following terms:

ackermann_in_gga(x0, x1)
U2_gga(x0, x1)
U3_gga(x0)
U1_gga(x0)

We have to consider all (P,Q,R)-chains.
By using the subterm criterion [20] together with the size-change analysis [32] we have proven that there are no infinite chains for this DP problem.

From the DPs we obtained the following set of size-change graphs: